<template>
  <div class="container page">
    <div class="img_one">


      <img src="https://www.rrjiaoyi.com/static/rr-min/home/index_wz_title@3x.png" mode="widthFix">
    </div>
  <div class="search" @click="predict">
    <p class="left">
      <img src="https://www.rrjiaoyi.com/static/rr-min/home/index_icon_serach@3x.png" mode="widthFix">
    </p>
    
    
    <!-- <input class="right" placeholder="搜索个股" focus="focus" /> -->
    <p class="right">搜索个股</p>
  </div>
  <!-- <div class="right">
    <p bindtap="bindButtonTap">测吧</p>
  </div> -->

    <!-- <div class="img_two">
      <img src="https://www.rrjiaoyi.com/static/rr-min/home/index_wz_sousuo@3x.png" mode="widthFix">
    </div> -->

  <!-- <div class="recomond">
    <p>1</p>
    <p>2</p>
    <p>3</p>
  </div>
  <div class="recomond">
    <p>1</p>
    <p>2</p>
    <p>3</p>
  </div> -->

  <p class="foot">每人每日可测2股</p>
  </div>
</template>
<script>
// var WXBizDataCrypt = require('@/tools/WXBizDataCrypt')
import qcloud from 'wafer2-client-sdk'
import YearProgress from '@/components/YearProgress'
import {showSuccess, showModal} from '@/util'
import {get, post} from '@/util'
import {get2, post2} from '@/server/api'
import config from '@/config'
export default {
  components: {
    YearProgress
  },
  data () {
    return {
      focus: true,
      inputValue: ''
    }
  },
  mounted () {
    this.userinfo = wx.getStorageSync('userinfo')
    // this.bookid = this.$root.$mp.query.id

    // this.demo().then(result => {
    // console.log('demo', result.data);
    // });
    
    // this.joke().then(result => {
    // console.log('joke', result.data.data.msg);
    // });

    // this.player().then(result => {
    //   this.playerRank = result
    //   console.log('joke', result);
    // });

  },
  onShareAppMessage() {
    return {
      title: `${wx.getStorageSync('userinfo').nickName}邀请你使用测股吧`,
      imageUrl: 'https://www.rrjiaoyi.com/static/rr-min/share/share.png',
      path: `/pages/me/main?sharepath=home`
    }
  },
  methods: {
    async player() {
      return await post('minipro/List', {}, {'api':'all', 'page':1})
    },
    async demo() {
    // return await get2('demo', {})
    },
    async joke() {
      return await get2('api/jokes', {})
    },
    predict () {
      wx.navigateTo({
        url: '/pages/search/main'
      })
    },
    jumpClick (comment) {
      wx.navigateTo({
        // url: '/pages/web-view/main'
        url: '/pages/web-view/main?path=' + 'https://wj.qq.com/s/2491547/f457/'
        // url: '/pages/detail/main'
      })
    },
    loginSuccess (res) {
      showSuccess('登录成功')
      wx.setStorageSync('userinfo', res)
      this.userinfo = res
    }

  },
  onShow () {
    // wx.showTabBarRedDot({index:1})
    // 加解密
    //   console.log('this.userinfo', wx.getStorageSync('userinfo'))
    // console.log('WXBizDataCrypt', WXBizDataCrypt)
    // wx.getWeRunData({
    //   success(res) {
    //     const encryptedData = res.encryptedData
    //     console.log('encryptedData', encryptedData)
    //   }
    // })

    // 拿code
    // wx.login({
    //   success(res) {
    //     console.log('res', res)
    //     if (res.code) {
    //       // 发起网络请求
    //       wx.request({
    //         url: 'https://test.com/onLogin',
    //         data: {
    //           code: res.code
    //         }
    //       })
    //     } else {
    //       console.log('登录失败！' + res.errMsg)
    //     }
    //   }
    // })
    // let userinfo = wx.getStorageSync('userinfo')
    // console.log([userinfo])
    // if (userinfo) {
    //   this.userinfo = userinfo
    // }
    // console.log(this.userinfo)
  }
}
</script>

<style lang='scss'>
.container{
  font-size: 30rpx;
  color: white;
  // background-color: #070d1b;
  // width: 100%;
  // line-height: 100%;
  // opacity: 0.7;
}
page {
  // background-color: #070d1b;
  background-color: #090f1d;
  // background-repeat:no-repeat; background-size:100% 100%;-moz-background-size:100% 100%;
  // background-image: url("https://www.rrjiaoyi.com/static/rr-min/common/bg@3x.png");
  width: 100%;
  height: 100%;
}
.section {
  text-align: center;
  margin-top: 200rpx;
  padding: 0 100rpx;
  display: flex;
  height: 80rpx;
  line-height: 80rpx;
  // .left {
  //   border-radius: 50px 0 0 50px;
  //   border: 1rpx solid  rgb(62, 207, 221);
  //   flex: 5;
  //   height: 80rpx;
  //   line-height: 80rpx;
  //   input {
  //     height: 80rpx;
  //     line-height: 80rpx;
  //   }
  // }
  // .right {
  //   border-radius: 0 50px 50px 0;
  //   border: 1rpx solid  rgb(62, 207, 221);
  //   background-color: rgb(62, 207, 221);
  //   flex: 2;
  //   height: 80rpx;
  //   line-height: 80rpx;
  // }
}
.search {
  text-align: center;
  margin: 0 100rpx;
  margin-top: 20rpx;
  height: 80rpx;
  line-height: 80rpx;
  border-radius: 50px;
  border: 1rpx solid  rgb(62, 207, 221);
  display: flex;
  input {
    height: 80rpx;
    line-height: 80rpx;
  }
  .left {
    flex: 1;
    height: 80rpx;
    line-height: 80rpx;
    image {
      // width: 50%;
      margin-top: 15rpx;
      height: 50rpx;
      width: 50rpx;
    }
  }
  .right {
    flex: 5;
    text-align: left;
    color: rgb(45, 161, 187);
  }
}
.img_one{
  // margin: 100rpx;
  // height: 100rpx;
  margin-top: 350rpx;
  text-align: center;
  img {
    width: 40%;
  }
}
.img_two{
  // margin: 100rpx;
  // height: 100rpx;
  // text-align: center;
  margin-top: 20rpx;
  margin-left: 100rpx;
  img {
    width: 30%;
  }
}
.recomond {
  display: flex;
  align-items: center;
  margin: 20rpx;
  p {
    text-align: center;
    flex: 1;
    margin: 20rpx;
  }
}
.foot {
  color: rgb(45, 161, 187);
  text-align: center;
  margin-top: 200rpx;
}
</style>
